<template>
  <div class="el-empty-wrapper">
    <div class="el-empty-img">
      <svg-icon
        v-if="useSvg"
        style="width: 100%;margin-bottom: 10px;height:80px;"
        icon-class="no-data"
      ></svg-icon>
      <img v-else :src="imgSrc" />
    </div>
    <span style="padding: 10px" class="el-empty-text">{{ text }}</span>
  </div>
</template>
<script>
export default {
  name: "ElEmpty",
  data() {
    return {};
  },
  props: {
    text: {
      type: String,
      required: false,
      default: "暂无数据"
    },
    useSvg: {
      type: Boolean,
      required: false,
      default: true
    },
    imgSrc: {
      type: String,
      required: false,
      default: ""
    }
  }
};
</script>
<style lang="scss" scoped>
.el-empty-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;

  flex-wrap: wrap;
  .el-empty-img {
    margin: 32px;
    width: 100%;
  }
  .el-empty-text {
    font-size: 14px;
    color: #00000040;
  }
}
</style>
